<?php

class myDateTime extends DateTime {

	public function debut_semaine() {
		$jour_sem = $this->format('N');
		$this->sub(new DateInterval('P'.($jour_sem-1).'D'));
	}

	public function fin_semaine() {
		$jour_sem = $this->format('N');
		$this->add(new DateInterval('P'.(6-($jour_sem-1)).'D'));
	}
	
	public function debut_semaine_suivante() {
		$jour_sem = $this->format('N');
		$this->add(new DateInterval('P'.(7-($jour_sem-1)).'D'));
	}

	public function debut_semaine_precedente() {
		$jour_sem = $this->format('N');
		$this->sub(new DateInterval('P'.($jour_sem-1+7).'D'));
	}

	public function copy() {
		return new myDateTime($this->format('Y-m-d'));
	}
}

?>